package com.by.zhdoctor.huanxin.model;

import io.swagger.client.model.MsgContent;

/**
 * 图片消息内容，拓展自MsgContent，以实现对图片内容的封装
 * Created by succy on 17-9-3.
 */
public class ImageMsgContent extends MsgContent {
    /**
     * 图片的url，环信需要先上传图片，获取url,才能发送
     */
    private String url;
    /**
     * 图片的文件名
     */
    private String filename;
    /**
     * 成功上传图片文件后返回的secret
     */
    private String secret;
    /**
     * 图片的尺寸
     */
    private Size size;

    public ImageMsgContent url(String url) {
        this.url = url;
        return this;
    }

    public ImageMsgContent filename(String filename) {
        this.filename = filename;
        return this;
    }

    public ImageMsgContent secret(String secret) {
        this.secret = secret;
        return this;
    }

    public ImageMsgContent size(Size size) {
        this.size = size;
        return this;
    }

    static class Size {
        private long width;
        private long height;

        Size(long width, long height) {
            this.width = width;
            this.height = height;
        }
    }
}
